﻿<%@ Page Title="Wild2" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Wild2.Models.Pages.Office.Index>" %>
<asp:Content ID="TitleContent" ContentPlaceHolderID="TitleContent" runat="server">
    <%= Resources.Home.Title %>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HeaderBlockContent" runat="server">
<%--Keywords--%>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="HeaderContent" runat="server">
    <%  String version = "pda"; if (Session[Wild2.Models.Constants.SessionConstants.VERSION] != null) version = Session[Wild2.Models.Constants.SessionConstants.VERSION].ToString(); %>
    <% Html.RenderPartial("~/Views/Shared/" + version + "/Header.ascx", "Личный кабинет"); %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%  String version = "pda"; if (Session[Wild2.Models.Constants.SessionConstants.VERSION] != null) version = Session[Wild2.Models.Constants.SessionConstants.VERSION].ToString(); %>
    <% if (!String.IsNullOrEmpty(Model.infoMessage))
       {
           Html.RenderPartial("~/Views/Shared/" + version + "/InfoBox.ascx", Model.infoMessage);
       } %>
       <div class="container">
    <% 
        Html.RenderPartial("~/Views/Shared/" + version + "/Panel.ascx", HttpUtility.HtmlEncode(Model.Aphorism));
        Html.RenderPartial("~/Views/Shared/" + version + "/Element.ascx", HttpUtility.HtmlEncode(Model.UserData.Address) + " [" + Html.ActionLink("изм", "Address") + "]");
        if (Model.isAvatar) Html.RenderPartial("~/Views/Shared/" + version + "/Element.ascx", "Аватар<br />изменить");
        else Html.RenderPartial("~/Views/Shared/" + version + "/Element.ascx", "Загрузить аватар");
        %>
        <div class="elb" style="padding: 0.4em">
            <% Html.BeginForm(); %>
            Главная страница<br />
            <% Dictionary<String, String> settings = Wild2.Models.User.Settings.GetUserSettings(Model.UserID.Value);
               string current = "";
               if (settings.Keys.Contains("homeurl")) current = settings["homeurl"];
               %>
            <%= Html.DropDownList("homeurl", new List<SelectListItem> { 
                                                                        new SelectListItem() { Text = "По умолчанию", Value = "", Selected = (current == "") }, 
                                                                        new SelectListItem() { Text = "Топ записи", Value = "top", Selected = (current == "top") }, 
                                                                        new SelectListItem() { Text = "Все записи", Value = "all", Selected = (current == "all") }, 
                                                                        new SelectListItem() { Text = "Мои записи", Value = "my", Selected = (current == "my") }, 
                                                                        new SelectListItem() { Text = "Песочница", Value = "sandbox", Selected = (current == "sandbox") } }, new { onchange = "javascript:submit();" })%>
            <% Html.EndForm(); %>
        </div>
        <%
            Html.RenderPartial("~/Views/Shared/" + version + "/Element.ascx", "Мой рейтинг: " + Model.UserData.Rating); //Выводить людей проголосовавших за и против
            Html.RenderPartial("~/Views/Shared/" + version + "/Element.ascx", Html.ActionLink("Инвайты", "Invites")); //Выводить ссылку на инвайты
            Html.RenderPartial("~/Views/Shared/" + version + "/Element.ascx", Html.ActionLink("Подписки", "Subscriptions")); //Выводить ссылку на инвайты
            Html.RenderPartial("~/Views/Shared/" + version + "/Element.ascx", Html.ActionLink("Моя анкета", "Index", "User", new { id = Model.UserID.Value }, new { }) + " [" + Html.ActionLink("изм", "Profile") + "]");
        %>
        </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="FooterContent" runat="server">
    <%  String version = "pda"; if (Session[Wild2.Models.Constants.SessionConstants.VERSION] != null) version = Session[Wild2.Models.Constants.SessionConstants.VERSION].ToString(); %>
    <% Html.RenderPartial("~/Views/Shared/" + version + "/Footer.ascx");
        %>
</asp:Content>